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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: C = None
        self.s: E = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

g = A("g")
m = B("m")
n = C("n")
f = D("f")
l = E("l")
b = A("b")
d = C("d")
a = E("a")
k = D("k")

g.z = b
g.q = l
m.z = b
n.u = d
n.w = f
f.r = k
f.t = n
f.v = m
f.p = d
l.z = k
l.w = n
l.x = n
l.s = a
l.o = b
b.z = g
b.q = l
d.u = n
d.w = k
a.z = f
a.w = n
a.x = n
a.s = l
a.o = b
k.r = f
k.t = n
k.v = m
k.p = d
assert l.o.z.z.q.o.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: C = None
        self.s: E = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

g = A("g")
m = B("m")
n = C("n")
f = D("f")
l = E("l")
b = A("b")
d = C("d")
a = E("a")
k = D("k")

g.z = b
g.q = l
m.z = b
n.u = d
n.w = f
f.r = k
f.t = n
f.v = m
f.p = d
l.z = k
l.w = n
l.x = n
l.s = a
l.o = b
b.z = g
b.q = l
d.u = n
d.w = k
a.z = f
a.w = n
a.x = n
a.s = l
a.o = b
k.r = f
k.t = n
k.v = m
k.p = d
assert l.o.z.z.q.o.z.z.z.z.txt == "b"