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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.s: D = None
        self.t: C = None
        self.txt = txt

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

f = A("f")
c = B("c")
k = C("k")
d = D("d")
i = E("i")
n = F("n")
m = E("m")
j = F("j")
e = F("e")

f.t = k
f.p = d
c.t = k
c.q = k
c.u = k
c.r = n
c.w = i
c.x = m
k.z = e
k.t = c
d.t = m
i.z = k
i.t = k
i.p = f
i.s = d
n.s = f
n.q = k
n.w = k
n.x = k
m.z = k
m.t = k
m.p = f
m.s = d
j.s = f
j.q = k
j.w = k
j.x = k
e.s = f
e.q = k
e.w = k
e.x = k
assert e.s.t.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.s: D = None
        self.t: C = None
        self.txt = txt

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

f = A("f")
c = B("c")
k = C("k")
d = D("d")
i = E("i")
n = F("n")
m = E("m")
j = F("j")
e = F("e")

f.t = k
f.p = d
c.t = k
c.q = k
c.u = k
c.r = n
c.w = i
c.x = m
k.z = e
k.t = c
d.t = m
i.z = k
i.t = k
i.p = f
i.s = d
n.s = f
n.q = k
n.w = k
n.x = k
m.z = k
m.t = k
m.p = f
m.s = d
j.s = f
j.q = k
j.w = k
j.x = k
e.s = f
e.q = k
e.w = k
e.x = k
assert e.s.t.z.s.txt == "f"