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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.q: B = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.q: B = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: C = None
        self.txt = txt

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

f.y = k
f.z = m
i.q = c
i.x = c
i.u = c
i.t = b
i.s = h
j.z = h
g.x = b
g.w = f
g.q = i
g.s = c
g.v = h
m.s = k
m.z = j
k.y = f
k.z = m
a.s = f
a.z = j
h.s = k
h.z = j
b.x = g
b.w = f
b.q = i
b.s = i
b.v = m
c.q = i
c.x = i
c.u = i
c.t = b
c.s = a
assert m.s.z.z.z.s.y.txt == "f"