class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

k.z = c
j.t = h
j.u = h
j.p = b
j.q = c
j.s = g
h.p = k
g.x = c
f.q = c
c.t = f
c.u = f
c.q = g
c.s = g
b.p = k
assert j.u.p.z.s.x.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

k.z = c
j.t = h
j.u = h
j.p = b
j.q = c
j.s = g
h.p = k
g.x = c
f.q = c
c.t = f
c.u = f
c.q = g
c.s = g
b.p = k
assert j.u.p.z.s.x.u.q.txt == "c"