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

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

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

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

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

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

i.y = g
i.u = k
i.s = b
b.z = a
b.p = a
b.q = g
a.p = b
a.y = b
a.q = k
m.v = b
m.r = b
m.s = a
n.r = j
n.s = a
k.v = b
k.r = b
k.s = a
j.r = n
j.s = a
g.y = i
g.u = f
g.s = b
f.v = b
f.r = b
f.s = a
assert j.s.q.s.q.s.y.p.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

i.y = g
i.u = k
i.s = b
b.z = a
b.p = a
b.q = g
a.p = b
a.y = b
a.q = k
m.v = b
m.r = b
m.s = a
n.r = j
n.s = a
k.v = b
k.r = b
k.s = a
j.r = n
j.s = a
g.y = i
g.u = f
g.s = b
f.v = b
f.r = b
f.s = a
assert j.s.q.s.q.s.y.p.y.p.txt == "a"