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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.q: A = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
d = C("d")
a = D("a")
b = E("b")
n = E("n")
j = A("j")
e = A("e")

g.v = d
l.u = e
d.s = n
d.o = b
d.q = j
a.p = n
a.y = n
a.t = l
a.v = g
a.o = e
b.o = n
b.w = a
b.p = g
b.y = d
b.q = d
n.o = b
n.w = a
n.p = j
n.y = d
n.q = d
j.v = d
e.v = d
assert d.s.o.p.v.o.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.q: A = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
d = C("d")
a = D("a")
b = E("b")
n = E("n")
j = A("j")
e = A("e")

g.v = d
l.u = e
d.s = n
d.o = b
d.q = j
a.p = n
a.y = n
a.t = l
a.v = g
a.o = e
b.o = n
b.w = a
b.p = g
b.y = d
b.q = d
n.o = b
n.w = a
n.p = j
n.y = d
n.q = d
j.v = d
e.v = d
assert d.s.o.p.v.o.y.q.txt == "j"