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

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

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

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

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

k.s = g
k.q = c
e.y = d
f.o = m
f.q = k
m.t = c
m.y = d
m.u = k
g.y = h
c.o = b
c.q = k
h.o = m
h.q = k
b.t = c
b.y = n
b.u = k
n.o = b
n.q = k
d.o = b
d.q = k
assert c.q.s.y.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

k.s = g
k.q = c
e.y = d
f.o = m
f.q = k
m.t = c
m.y = d
m.u = k
g.y = h
c.o = b
c.q = k
h.o = m
h.q = k
b.t = c
b.y = n
b.u = k
n.o = b
n.q = k
d.o = b
d.q = k
assert c.q.s.y.q.q.q.txt == "k"