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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
f = C("f")
a = D("a")
e = E("e")
i = E("i")
b = D("b")
c = A("c")
k = B("k")
l = E("l")

d.o = f
d.u = f
g.z = k
g.w = b
f.w = e
a.y = d
a.p = d
a.r = e
a.o = l
a.q = b
e.y = b
e.p = a
e.q = a
i.y = a
i.p = a
i.q = a
b.y = d
b.p = d
b.r = e
b.o = i
b.q = a
c.o = f
c.u = f
k.z = g
k.w = a
l.y = a
l.p = a
l.q = a
assert k.z.w.p.o.w.y.q.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
f = C("f")
a = D("a")
e = E("e")
i = E("i")
b = D("b")
c = A("c")
k = B("k")
l = E("l")

d.o = f
d.u = f
g.z = k
g.w = b
f.w = e
a.y = d
a.p = d
a.r = e
a.o = l
a.q = b
e.y = b
e.p = a
e.q = a
i.y = a
i.p = a
i.q = a
b.y = d
b.p = d
b.r = e
b.o = i
b.q = a
c.o = f
c.u = f
k.z = g
k.w = a
l.y = a
l.p = a
l.q = a
assert k.z.w.p.o.w.y.q.y.o.txt == "f"