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

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

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

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

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

a = A("a")
b = B("b")
j = C("j")
k = D("k")
f = E("f")
d = D("d")
l = D("l")
n = B("n")
i = E("i")
h = B("h")

a.o = h
a.y = j
b.v = a
b.y = a
b.r = d
b.q = f
b.p = j
j.u = a
k.w = f
k.y = l
f.r = j
f.o = h
f.q = h
f.p = h
f.s = l
d.w = i
d.y = k
l.w = i
l.y = k
n.v = a
n.y = a
n.r = l
n.q = f
n.p = j
i.r = j
i.o = n
i.q = n
i.s = l
i.p = b
h.v = a
h.y = a
h.r = k
h.q = i
h.p = j
assert i.s.w.s.y.w.o.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

a = A("a")
b = B("b")
j = C("j")
k = D("k")
f = E("f")
d = D("d")
l = D("l")
n = B("n")
i = E("i")
h = B("h")

a.o = h
a.y = j
b.v = a
b.y = a
b.r = d
b.q = f
b.p = j
j.u = a
k.w = f
k.y = l
f.r = j
f.o = h
f.q = h
f.p = h
f.s = l
d.w = i
d.y = k
l.w = i
l.y = k
n.v = a
n.y = a
n.r = l
n.q = f
n.p = j
i.r = j
i.o = n
i.q = n
i.s = l
i.p = b
h.v = a
h.y = a
h.r = k
h.q = i
h.p = j
assert i.s.w.s.y.w.o.q.q.q.txt == "f"