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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

a.r = j
a.z = l
a.x = k
a.q = k
a.o = g
l.r = e
l.q = h
f.r = i
f.z = l
f.u = e
h.v = f
h.o = f
k.v = e
k.s = e
k.u = g
e.r = i
e.z = l
e.u = f
n.r = j
n.z = g
n.o = g
n.x = i
n.q = k
g.r = f
g.q = h
j.r = a
j.z = l
j.x = k
j.q = k
j.o = g
i.v = f
i.u = g
i.s = e
assert j.x.s.z.q.o.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.x: E = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

a.r = j
a.z = l
a.x = k
a.q = k
a.o = g
l.r = e
l.q = h
f.r = i
f.z = l
f.u = e
h.v = f
h.o = f
k.v = e
k.s = e
k.u = g
e.r = i
e.z = l
e.u = f
n.r = j
n.z = g
n.o = g
n.x = i
n.q = k
g.r = f
g.q = h
j.r = a
j.z = l
j.x = k
j.q = k
j.o = g
i.v = f
i.u = g
i.s = e
assert j.x.s.z.q.o.r.u.r.txt == "f"