class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

m = A("m")
b = B("b")
i = C("i")
a = D("a")
g = E("g")
j = C("j")
n = E("n")
f = B("f")

m.t = n
b.z = n
i.p = a
i.y = n
i.r = n
i.w = j
i.q = m
a.w = i
a.r = g
g.x = j
g.o = n
j.p = a
j.y = g
j.w = i
j.r = n
j.q = m
n.x = i
n.o = g
f.z = n
assert n.x.q.t.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

m = A("m")
b = B("b")
i = C("i")
a = D("a")
g = E("g")
j = C("j")
n = E("n")
f = B("f")

m.t = n
b.z = n
i.p = a
i.y = n
i.r = n
i.w = j
i.q = m
a.w = i
a.r = g
g.x = j
g.o = n
j.p = a
j.y = g
j.w = i
j.r = n
j.q = m
n.x = i
n.o = g
f.z = n
assert n.x.q.t.x.y.txt == "n"