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

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

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

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

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

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

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

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

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

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

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

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

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