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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: E = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: C = None
        self.q: B = None
        self.txt = txt

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

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

i = A("i")
k = B("k")
j = C("j")
h = D("h")
f = E("f")
c = F("c")

i.q = c
i.z = c
i.t = c
i.u = j
i.w = j
i.o = k
k.y = f
k.q = f
k.s = h
k.r = h
j.r = i
j.p = i
j.s = k
h.r = k
h.q = k
h.s = j
f.q = c
f.x = c
f.r = k
f.z = k
f.s = j
f.u = i
c.x = j
assert k.s.q.r.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: F = None
        self.t: F = None
        self.u: C = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: E = None
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: C = None
        self.q: B = None
        self.txt = txt

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

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

i = A("i")
k = B("k")
j = C("j")
h = D("h")
f = E("f")
c = F("c")

i.q = c
i.z = c
i.t = c
i.u = j
i.w = j
i.o = k
k.y = f
k.q = f
k.s = h
k.r = h
j.r = i
j.p = i
j.s = k
h.r = k
h.q = k
h.s = j
f.q = c
f.x = c
f.r = k
f.z = k
f.s = j
f.u = i
c.x = j
assert k.s.q.r.s.p.txt == "i"