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

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

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

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

m = A("m")
i = B("i")
l = C("l")
g = D("g")
j = A("j")
b = B("b")
a = D("a")
n = C("n")
k = A("k")

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

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

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

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

m = A("m")
i = B("i")
l = C("l")
g = D("g")
j = A("j")
b = B("b")
a = D("a")
n = C("n")
k = A("k")

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