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

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

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

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

b = A("b")
n = B("n")
k = C("k")
m = D("m")
l = D("l")
e = C("e")
a = C("a")
c = A("c")
j = D("j")

b.v = c
n.u = a
k.o = j
k.z = c
k.w = m
k.u = a
m.q = n
m.x = b
m.s = j
l.q = n
l.x = c
l.s = j
e.o = l
e.z = b
e.w = j
e.u = a
a.o = m
a.z = c
a.w = j
a.u = e
c.v = b
j.q = n
j.x = b
j.s = l
assert n.u.u.u.o.q.u.z.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

b = A("b")
n = B("n")
k = C("k")
m = D("m")
l = D("l")
e = C("e")
a = C("a")
c = A("c")
j = D("j")

b.v = c
n.u = a
k.o = j
k.z = c
k.w = m
k.u = a
m.q = n
m.x = b
m.s = j
l.q = n
l.x = c
l.s = j
e.o = l
e.z = b
e.w = j
e.u = a
a.o = m
a.z = c
a.w = j
a.u = e
c.v = b
j.q = n
j.x = b
j.s = l
assert n.u.u.u.o.q.u.z.v.v.txt == "c"