class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: E = None
        self.p: B = None
        self.t: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.w: B = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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