class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: A = None
        self.z: D = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.t: B = None
        self.r: D = None
        self.o: B = None
        self.u: F = None
        self.txt = txt

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

m = A("m")
l = B("l")
c = C("c")
g = D("g")
b = E("b")
k = F("k")
f = A("f")

m.v = g
m.z = g
m.t = g
m.u = g
m.w = f
l.q = k
l.v = c
l.x = m
c.p = m
g.x = c
g.z = b
b.w = g
b.r = g
b.s = l
b.t = l
b.o = l
b.u = k
k.q = m
k.v = b
f.v = g
f.z = g
f.t = g
f.u = g
f.w = m
assert c.p.t.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: A = None
        self.z: D = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: B = None
        self.t: B = None
        self.r: D = None
        self.o: B = None
        self.u: F = None
        self.txt = txt

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

m = A("m")
l = B("l")
c = C("c")
g = D("g")
b = E("b")
k = F("k")
f = A("f")

m.v = g
m.z = g
m.t = g
m.u = g
m.w = f
l.q = k
l.v = c
l.x = m
c.p = m
g.x = c
g.z = b
b.w = g
b.r = g
b.s = l
b.t = l
b.o = l
b.u = k
k.q = m
k.v = b
f.v = g
f.z = g
f.t = g
f.u = g
f.w = m
assert c.p.t.x.p.txt == "m"