class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.u: D = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

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