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

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

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

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

j = A("j")
k = B("k")
h = C("h")
b = D("b")
l = B("l")
c = C("c")
a = A("a")
m = C("m")
f = C("f")

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

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

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

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

j = A("j")
k = B("k")
h = C("h")
b = D("b")
l = B("l")
c = C("c")
a = A("a")
m = C("m")
f = C("f")

j.v = k
j.t = b
j.o = l
k.p = b
k.o = m
k.t = h
h.v = b
h.s = b
h.y = b
h.t = j
b.x = j
l.p = b
l.o = f
l.t = h
c.v = b
c.s = b
c.y = b
c.t = a
a.v = k
a.o = k
a.t = b
m.v = b
m.s = b
m.y = b
m.t = a
f.v = b
f.s = b
f.y = b
f.t = a
assert l.o.t.o.p.x.t.txt == "b"