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

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

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

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

i = A("i")
e = B("e")
f = C("f")
a = D("a")
l = B("l")
n = C("n")
k = A("k")
d = D("d")
j = B("j")

i.o = k
e.p = i
e.q = f
e.r = f
f.o = a
f.p = j
a.v = d
a.r = d
a.u = n
a.y = k
l.p = i
l.q = n
l.r = f
n.o = d
n.p = l
k.o = i
d.v = a
d.r = a
d.u = n
d.y = k
j.p = k
j.q = n
j.r = n
assert e.q.p.p.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

i = A("i")
e = B("e")
f = C("f")
a = D("a")
l = B("l")
n = C("n")
k = A("k")
d = D("d")
j = B("j")

i.o = k
e.p = i
e.q = f
e.r = f
f.o = a
f.p = j
a.v = d
a.r = d
a.u = n
a.y = k
l.p = i
l.q = n
l.r = f
n.o = d
n.p = l
k.o = i
d.v = a
d.r = a
d.u = n
d.y = k
j.p = k
j.q = n
j.r = n
assert e.q.p.p.o.o.o.o.txt == "k"