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

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

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

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

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

i.o = g
i.q = m
f.s = e
f.v = b
f.u = k
f.t = g
m.p = f
g.x = n
g.p = j
g.u = j
e.p = b
k.x = n
k.p = j
k.u = j
b.s = e
b.v = f
b.u = k
b.t = k
n.s = m
n.v = b
n.u = k
n.t = g
j.o = g
j.q = m
assert k.u.q.p.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

i.o = g
i.q = m
f.s = e
f.v = b
f.u = k
f.t = g
m.p = f
g.x = n
g.p = j
g.u = j
e.p = b
k.x = n
k.p = j
k.u = j
b.s = e
b.v = f
b.u = k
b.t = k
n.s = m
n.v = b
n.u = k
n.t = g
j.o = g
j.q = m
assert k.u.q.p.u.u.txt == "j"