class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.v: A = None
        self.q: F = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.t: F = None
        self.s: F = None
        self.o: F = None
        self.txt = txt

m = A("m")
a = B("a")
f = C("f")
e = D("e")
n = E("n")
b = F("b")
k = F("k")

m.v = n
m.p = e
m.r = k
a.y = n
a.u = n
a.p = f
a.v = m
a.q = k
a.z = e
f.r = a
e.v = m
e.r = f
e.y = b
n.x = m
n.p = a
n.t = f
b.w = a
b.q = f
b.t = k
b.s = k
b.o = k
k.w = a
k.q = f
k.t = b
k.s = b
k.o = b
assert b.w.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: C = None
        self.v: A = None
        self.q: F = None
        self.z: D = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: C = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.t: F = None
        self.s: F = None
        self.o: F = None
        self.txt = txt

m = A("m")
a = B("a")
f = C("f")
e = D("e")
n = E("n")
b = F("b")
k = F("k")

m.v = n
m.p = e
m.r = k
a.y = n
a.u = n
a.p = f
a.v = m
a.q = k
a.z = e
f.r = a
e.v = m
e.r = f
e.y = b
n.x = m
n.p = a
n.t = f
b.w = a
b.q = f
b.t = k
b.s = k
b.o = k
k.w = a
k.q = f
k.t = b
k.s = b
k.o = b
assert b.w.v.p.txt == "e"