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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

j = A("j")
m = B("m")
n = C("n")
g = D("g")
d = E("d")
f = C("f")
k = B("k")
h = C("h")

j.y = d
j.u = g
m.z = j
m.y = d
m.s = d
n.y = d
n.q = d
n.z = d
n.x = f
n.u = m
g.o = f
g.r = h
g.p = j
g.v = d
d.z = j
d.s = j
d.o = g
d.y = m
f.y = d
f.q = d
f.z = d
f.x = h
f.u = k
k.z = j
k.y = d
k.s = d
h.y = d
h.q = d
h.z = d
h.x = n
h.u = m
assert k.z.u.v.y.s.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

j = A("j")
m = B("m")
n = C("n")
g = D("g")
d = E("d")
f = C("f")
k = B("k")
h = C("h")

j.y = d
j.u = g
m.z = j
m.y = d
m.s = d
n.y = d
n.q = d
n.z = d
n.x = f
n.u = m
g.o = f
g.r = h
g.p = j
g.v = d
d.z = j
d.s = j
d.o = g
d.y = m
f.y = d
f.q = d
f.z = d
f.x = h
f.u = k
k.z = j
k.y = d
k.s = d
h.y = d
h.q = d
h.z = d
h.x = n
h.u = m
assert k.z.u.v.y.s.s.y.s.txt == "j"