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

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

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

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

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

i = A("i")
m = B("m")
h = C("h")
f = D("f")
g = E("g")
e = E("e")
b = A("b")

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

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

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

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

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

i = A("i")
m = B("m")
h = C("h")
f = D("f")
g = E("g")
e = E("e")
b = A("b")

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