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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: B = None
        self.o: A = None
        self.y: B = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.t: E = None
        self.q: A = None
        self.v: E = None
        self.txt = txt

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

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

j.x = g
j.u = g
j.q = m
j.y = i
f.p = g
f.v = a
f.y = a
f.o = j
f.q = i
c.x = j
m.w = g
m.y = i
m.t = i
m.v = i
m.q = j
i.p = f
i.s = m
i.x = c
g.w = m
g.y = i
g.t = i
g.v = i
g.q = j
a.p = g
a.v = f
a.y = f
a.o = j
a.q = i
assert m.y.x.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.q: D = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: B = None
        self.o: A = None
        self.y: B = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.t: E = None
        self.q: A = None
        self.v: E = None
        self.txt = txt

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

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

j.x = g
j.u = g
j.q = m
j.y = i
f.p = g
f.v = a
f.y = a
f.o = j
f.q = i
c.x = j
m.w = g
m.y = i
m.t = i
m.v = i
m.q = j
i.p = f
i.s = m
i.x = c
g.w = m
g.y = i
g.t = i
g.v = i
g.q = j
a.p = g
a.v = f
a.y = f
a.o = j
a.q = i
assert m.y.x.x.y.txt == "i"