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

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

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

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

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

k.r = m
k.t = m
k.z = g
n.o = c
c.s = f
m.q = c
m.y = c
m.s = f
g.r = m
g.t = m
g.z = e
l.r = m
l.t = m
l.z = e
f.o = c
e.r = m
e.t = m
e.z = k
b.r = m
b.t = m
b.z = g
j.r = m
j.t = m
j.z = b
assert l.r.q.s.o.s.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

k.r = m
k.t = m
k.z = g
n.o = c
c.s = f
m.q = c
m.y = c
m.s = f
g.r = m
g.t = m
g.z = e
l.r = m
l.t = m
l.z = e
f.o = c
e.r = m
e.t = m
e.z = k
b.r = m
b.t = m
b.z = g
j.r = m
j.t = m
j.z = b
assert l.r.q.s.o.s.o.s.o.txt == "c"