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

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

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

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

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

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

m = A("m")
f = B("f")
a = C("a")
b = D("b")
j = E("j")
g = F("g")
c = D("c")
e = B("e")

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

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

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

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

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

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

m = A("m")
f = B("f")
a = C("a")
b = D("b")
j = E("j")
g = F("g")
c = D("c")
e = B("e")

m.x = j
f.p = j
f.s = c
f.q = a
f.v = b
f.u = m
a.q = m
b.o = a
b.t = j
j.u = a
j.w = a
j.t = m
j.z = g
j.v = g
j.y = e
g.p = m
g.t = j
c.o = a
c.t = j
e.p = j
e.s = c
e.q = a
e.v = b
e.u = m
assert b.t.y.s.t.txt == "j"