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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.u: A = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

b = A("b")
k = B("k")
g = C("g")
e = D("e")
n = E("n")
l = D("l")
d = B("d")
m = E("m")
f = B("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.u: A = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

b = A("b")
k = B("k")
g = C("g")
e = D("e")
n = E("n")
l = D("l")
d = B("d")
m = E("m")
f = B("f")

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