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

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

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

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

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

d.o = l
d.s = l
f.o = a
f.y = a
f.p = c
j.y = k
j.s = k
j.v = e
j.p = e
e.o = k
e.s = j
e.t = j
a.o = l
a.p = c
a.y = f
l.o = f
l.y = f
l.p = c
k.y = j
k.s = j
k.v = e
k.p = e
c.o = l
c.s = a
assert j.s.s.p.o.v.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

d.o = l
d.s = l
f.o = a
f.y = a
f.p = c
j.y = k
j.s = k
j.v = e
j.p = e
e.o = k
e.s = j
e.t = j
a.o = l
a.p = c
a.y = f
l.o = f
l.y = f
l.p = c
k.y = j
k.s = j
k.v = e
k.p = e
c.o = l
c.s = a
assert j.s.s.p.o.v.s.s.s.txt == "j"