  Algebraic structures in which the property of commutativity is substituted by
the mediality property are introduced. We consider (associative) graded
algebras and instead of almost commutativity (generalized commutativity or
$\varepsilon$-commutativity) we introduce almost mediality
("commutativity-to-mediality" ansatz). Higher graded twisted products and
"deforming" brackets (being the medial analog of Lie brackets) are defined.
Toyoda's theorem which connects (universal) medial algebras with abelian
algebras is proven for the almost medial graded algebras introduced here. In a
similar way we generalize tensor categories and braided tensor categories. A
polyadic (non-strict) tensor category has an $n$-ary tensor product as an
additional multiplication with $n-1$ associators of the arity $2n-1$ satisfying
a $\left( n^{2}+1\right) $-gon relation, which is a polyadic analog of the
pentagon axiom. Polyadic monoidal categories may contain several unit objects,
and it is also possible that all objects are units. A new kind of polyadic
categories (called "groupal") is defined: they are close to monoidal
categories, but may not contain units: instead the querfunctor and (natural)
functorial isomorphisms, the quertors, are considered (by analogy with the
querelements in $n$-ary groups). The arity-nonreducible $n$-ary braiding is
introduced and the equation for it is derived, which for $n=2$ coincides with
the Yang-Baxter equation. Then, analogously to the first part of the paper, we
introduce "medialing" instead of braiding and construct "medialed" polyadic
tensor categories.
