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

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

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

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

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

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

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

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

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

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

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

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

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