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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.p: D = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.p: D = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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