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

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

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

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

d = A("d")
k = B("k")
b = C("b")
l = D("l")
j = A("j")
e = D("e")
n = B("n")
c = C("c")
g = A("g")

d.v = n
d.y = e
d.t = l
d.x = g
k.t = l
k.p = b
k.u = c
b.p = d
b.v = d
b.w = e
l.o = e
l.w = d
l.t = j
j.v = k
j.y = l
j.t = l
j.x = d
e.o = l
e.w = j
e.t = d
n.t = l
n.p = b
n.u = b
c.p = j
c.w = e
c.v = d
g.v = n
g.y = e
g.t = l
g.x = d
assert l.t.y.t.v.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: D = None
        self.t: D = None
        self.x: A = None
        self.txt = txt

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

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

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

d = A("d")
k = B("k")
b = C("b")
l = D("l")
j = A("j")
e = D("e")
n = B("n")
c = C("c")
g = A("g")

d.v = n
d.y = e
d.t = l
d.x = g
k.t = l
k.p = b
k.u = c
b.p = d
b.v = d
b.w = e
l.o = e
l.w = d
l.t = j
j.v = k
j.y = l
j.t = l
j.x = d
e.o = l
e.w = j
e.t = d
n.t = l
n.p = b
n.u = b
c.p = j
c.w = e
c.v = d
g.v = n
g.y = e
g.t = l
g.x = d
assert l.t.y.t.v.u.p.txt == "j"