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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: A = None
        self.t: A = None
        self.s: C = None
        self.u: C = None
        self.txt = txt

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

i.t = g
i.q = l
g.w = k
g.r = a
g.y = i
g.u = h
g.t = m
m.u = h
k.t = h
k.x = a
h.x = a
h.v = l
h.t = i
h.s = f
h.u = f
f.u = h
e.w = k
e.r = a
e.y = l
e.u = h
e.t = m
a.w = k
a.r = g
a.y = l
a.u = h
a.t = f
l.t = a
l.q = i
assert h.v.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: A = None
        self.t: A = None
        self.s: C = None
        self.u: C = None
        self.txt = txt

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

i.t = g
i.q = l
g.w = k
g.r = a
g.y = i
g.u = h
g.t = m
m.u = h
k.t = h
k.x = a
h.x = a
h.v = l
h.t = i
h.s = f
h.u = f
f.u = h
e.w = k
e.r = a
e.y = l
e.u = h
e.t = m
a.w = k
a.r = g
a.y = l
a.u = h
a.t = f
l.t = a
l.q = i
assert h.v.q.t.txt == "g"