class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: D = None
        self.s: D = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.o: B = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

n = A("n")
c = B("c")
i = C("i")
k = D("k")
b = E("b")
m = E("m")
a = C("a")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.o: B = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

n = A("n")
c = B("c")
i = C("i")
k = D("k")
b = E("b")
m = E("m")
a = C("a")
l = B("l")

n.q = i
n.t = k
n.s = k
n.p = k
n.o = m
c.r = n
c.u = n
c.t = l
c.o = l
c.v = k
i.o = c
i.r = a
k.p = i
k.s = a
k.t = a
k.w = n
b.v = i
b.z = k
m.v = a
m.z = k
a.o = l
a.r = i
l.r = n
l.u = n
l.t = c
l.o = c
l.v = k
assert m.v.r.r.r.txt == "i"