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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

j = A("j")
c = B("c")
m = C("m")
b = D("b")
l = B("l")
n = D("n")
f = B("f")
e = B("e")
a = A("a")
i = C("i")

j.y = i
j.t = n
c.o = n
c.v = n
c.x = i
c.t = j
m.p = i
m.v = i
b.r = c
b.v = j
b.t = a
l.o = n
l.v = n
l.x = i
l.t = a
n.r = f
n.v = j
n.t = j
f.o = b
f.v = n
f.x = m
f.t = j
e.o = n
e.v = b
e.x = m
e.t = j
a.y = m
a.t = n
i.p = m
i.v = m
assert b.t.y.v.v.p.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

j = A("j")
c = B("c")
m = C("m")
b = D("b")
l = B("l")
n = D("n")
f = B("f")
e = B("e")
a = A("a")
i = C("i")

j.y = i
j.t = n
c.o = n
c.v = n
c.x = i
c.t = j
m.p = i
m.v = i
b.r = c
b.v = j
b.t = a
l.o = n
l.v = n
l.x = i
l.t = a
n.r = f
n.v = j
n.t = j
f.o = b
f.v = n
f.x = m
f.t = j
e.o = n
e.v = b
e.x = m
e.t = j
a.y = m
a.t = n
i.p = m
i.v = m
assert b.t.y.v.v.p.p.v.txt == "i"