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

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

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

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

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

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

k.o = a
k.t = a
k.p = g
k.w = g
k.u = j
g.w = a
g.r = j
n.t = g
n.u = g
n.x = a
n.w = j
n.v = j
a.v = k
a.q = n
a.p = l
j.q = a
l.o = a
l.t = a
l.p = g
l.w = g
l.u = j
assert n.w.q.v.w.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.u: E = None
        self.w: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

k.o = a
k.t = a
k.p = g
k.w = g
k.u = j
g.w = a
g.r = j
n.t = g
n.u = g
n.x = a
n.w = j
n.v = j
a.v = k
a.q = n
a.p = l
j.q = a
l.o = a
l.t = a
l.p = g
l.w = g
l.u = j
assert n.w.q.v.w.r.q.txt == "a"