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

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

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

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

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

g = A("g")
i = B("i")
l = C("l")
c = D("c")
h = E("h")
e = E("e")
n = A("n")
d = B("d")

g.q = n
g.z = c
g.u = d
g.w = l
g.x = l
i.u = c
i.x = n
i.v = n
i.q = h
l.r = i
l.q = e
c.q = l
c.s = l
c.y = l
c.o = n
c.w = g
h.r = e
h.o = e
e.r = h
e.o = h
n.q = g
n.z = c
n.u = i
n.w = l
n.x = l
d.u = c
d.x = g
d.q = h
d.v = n
assert e.r.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: D = None
        self.u: B = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

g = A("g")
i = B("i")
l = C("l")
c = D("c")
h = E("h")
e = E("e")
n = A("n")
d = B("d")

g.q = n
g.z = c
g.u = d
g.w = l
g.x = l
i.u = c
i.x = n
i.v = n
i.q = h
l.r = i
l.q = e
c.q = l
c.s = l
c.y = l
c.o = n
c.w = g
h.r = e
h.o = e
e.r = h
e.o = h
n.q = g
n.z = c
n.u = i
n.w = l
n.x = l
d.u = c
d.x = g
d.q = h
d.v = n
assert e.r.r.o.r.txt == "e"