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

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

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

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

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

g = A("g")
b = B("b")
n = C("n")
h = D("h")
l = E("l")
e = C("e")
j = B("j")

g.y = n
g.q = j
g.x = b
b.r = h
b.x = j
b.o = l
n.z = l
n.q = e
h.q = n
h.x = b
h.p = b
h.r = g
h.v = e
l.r = j
l.t = j
l.o = n
l.x = n
l.u = h
e.z = l
e.q = n
j.r = h
j.x = b
j.o = l
assert g.q.o.o.z.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

g = A("g")
b = B("b")
n = C("n")
h = D("h")
l = E("l")
e = C("e")
j = B("j")

g.y = n
g.q = j
g.x = b
b.r = h
b.x = j
b.o = l
n.z = l
n.q = e
h.q = n
h.x = b
h.p = b
h.r = g
h.v = e
l.r = j
l.t = j
l.o = n
l.x = n
l.u = h
e.z = l
e.q = n
j.r = h
j.x = b
j.o = l
assert g.q.o.o.z.x.q.txt == "e"