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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.u: E = None
        self.txt = txt

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

a = A("a")
k = B("k")
n = C("n")
g = D("g")
e = E("e")
b = A("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.u: E = None
        self.txt = txt

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

a = A("a")
k = B("k")
n = C("n")
g = D("g")
e = E("e")
b = A("b")

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