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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

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

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

i.q = n
h.y = g
h.r = k
h.x = a
h.o = e
a.p = c
a.y = h
a.w = i
a.o = e
g.o = e
g.z = k
g.v = h
g.s = h
b.z = k
b.r = h
k.z = b
k.r = h
f.o = a
f.z = k
f.v = h
f.s = h
n.o = a
n.z = k
n.v = h
n.s = h
c.q = n
e.p = c
e.y = h
e.w = i
e.o = a
assert b.r.o.o.y.r.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

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

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

i.q = n
h.y = g
h.r = k
h.x = a
h.o = e
a.p = c
a.y = h
a.w = i
a.o = e
g.o = e
g.z = k
g.v = h
g.s = h
b.z = k
b.r = h
k.z = b
k.r = h
f.o = a
f.z = k
f.v = h
f.s = h
n.o = a
n.z = k
n.v = h
n.s = h
c.q = n
e.p = c
e.y = h
e.w = i
e.o = a
assert b.r.o.o.y.r.z.r.x.txt == "a"