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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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