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

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

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

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

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

d = A("d")
a = B("a")
l = C("l")
n = D("n")
c = E("c")
k = A("k")
b = D("b")

d.q = a
a.u = c
a.q = c
a.x = d
a.y = k
l.o = n
l.q = n
l.t = n
n.v = d
n.w = a
n.s = a
n.u = b
n.r = b
c.w = l
c.x = a
c.q = a
c.s = k
c.p = n
k.q = a
b.v = d
b.w = a
b.s = a
b.u = n
b.r = n
assert b.v.q.x.q.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

d = A("d")
a = B("a")
l = C("l")
n = D("n")
c = E("c")
k = A("k")
b = D("b")

d.q = a
a.u = c
a.q = c
a.x = d
a.y = k
l.o = n
l.q = n
l.t = n
n.v = d
n.w = a
n.s = a
n.u = b
n.r = b
c.w = l
c.x = a
c.q = a
c.s = k
c.p = n
k.q = a
b.v = d
b.w = a
b.s = a
b.u = n
b.r = n
assert b.v.q.x.q.y.q.txt == "a"