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

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

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

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

i = A("i")
c = B("c")
h = C("h")
g = D("g")
d = D("d")
k = B("k")
f = D("f")
m = C("m")
l = D("l")

i.s = d
i.x = m
i.o = c
c.s = m
c.t = i
c.p = i
h.t = i
h.q = i
g.u = h
g.o = i
d.u = h
d.o = i
k.s = h
k.t = i
k.p = i
f.u = h
f.o = i
m.t = i
m.q = i
l.u = m
l.o = i
assert h.q.o.s.t.s.o.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

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

i = A("i")
c = B("c")
h = C("h")
g = D("g")
d = D("d")
k = B("k")
f = D("f")
m = C("m")
l = D("l")

i.s = d
i.x = m
i.o = c
c.s = m
c.t = i
c.p = i
h.t = i
h.q = i
g.u = h
g.o = i
d.u = h
d.o = i
k.s = h
k.t = i
k.p = i
f.u = h
f.o = i
m.t = i
m.q = i
l.u = m
l.o = i
assert h.q.o.s.t.s.o.o.s.txt == "m"