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

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

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

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

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

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

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

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

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

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

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

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

i.v = k
i.t = e
i.r = f
i.p = j
e.z = k
k.q = n
c.y = e
c.p = e
c.r = i
c.z = h
c.x = n
j.z = e
j.x = c
j.r = h
j.t = k
j.u = f
n.y = e
n.p = e
n.r = i
n.z = j
n.x = c
h.z = e
h.x = c
h.r = j
h.t = k
h.u = f
f.v = k
f.t = e
f.r = i
f.p = j
assert k.q.z.z.z.q.x.x.r.txt == "i"