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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.q: E = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

i = A("i")
g = B("g")
m = C("m")
f = D("f")
j = E("j")
d = F("d")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.q: E = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

i = A("i")
g = B("g")
m = C("m")
f = D("f")
j = E("j")
d = F("d")

i.z = m
i.s = g
g.x = i
m.x = i
m.t = i
m.q = g
m.p = d
m.u = j
f.r = i
f.z = i
f.p = m
f.y = d
f.q = g
j.v = f
d.o = m
d.v = j
d.q = j
d.x = g
d.z = f
assert g.x.s.x.z.p.txt == "d"