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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

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

b = A("b")
f = B("f")
n = C("n")
g = D("g")
i = B("i")
d = D("d")
a = D("a")
k = C("k")
l = C("l")

b.q = a
b.s = f
b.o = g
b.v = d
f.w = l
f.t = b
n.r = f
n.y = f
n.u = l
n.x = k
g.v = d
g.x = a
g.p = b
g.z = b
i.w = l
i.t = b
d.v = a
d.x = a
d.p = b
d.z = b
a.v = d
a.x = d
a.p = b
a.z = b
k.r = f
k.y = i
k.u = l
k.x = l
l.r = f
l.y = i
l.u = k
l.x = k
assert a.v.z.s.t.o.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.u: C = None
        self.x: C = None
        self.txt = txt

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

b = A("b")
f = B("f")
n = C("n")
g = D("g")
i = B("i")
d = D("d")
a = D("a")
k = C("k")
l = C("l")

b.q = a
b.s = f
b.o = g
b.v = d
f.w = l
f.t = b
n.r = f
n.y = f
n.u = l
n.x = k
g.v = d
g.x = a
g.p = b
g.z = b
i.w = l
i.t = b
d.v = a
d.x = a
d.p = b
d.z = b
a.v = d
a.x = d
a.p = b
a.z = b
k.r = f
k.y = i
k.u = l
k.x = l
l.r = f
l.y = i
l.u = k
l.x = k
assert a.v.z.s.t.o.p.v.txt == "d"