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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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