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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

j = A("j")
g = B("g")
l = C("l")
e = D("e")
d = A("d")
h = C("h")
a = A("a")
i = B("i")

j.q = l
j.s = g
j.z = h
g.q = i
l.o = e
l.u = e
l.y = e
l.t = h
e.r = i
e.x = i
e.z = j
e.t = a
d.q = l
d.z = l
d.s = g
h.o = e
h.u = e
h.y = e
h.t = l
a.q = h
a.s = g
a.z = l
i.q = g
assert i.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

j = A("j")
g = B("g")
l = C("l")
e = D("e")
d = A("d")
h = C("h")
a = A("a")
i = B("i")

j.q = l
j.s = g
j.z = h
g.q = i
l.o = e
l.u = e
l.y = e
l.t = h
e.r = i
e.x = i
e.z = j
e.t = a
d.q = l
d.z = l
d.s = g
h.o = e
h.u = e
h.y = e
h.t = l
a.q = h
a.s = g
a.z = l
i.q = g
assert i.q.q.q.q.q.q.txt == "i"