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

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

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

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

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

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

b.o = l
b.u = c
c.v = a
k.q = a
k.w = a
k.x = g
a.v = g
a.z = c
a.y = k
g.u = a
g.z = a
g.p = a
g.y = k
h.v = a
e.u = a
e.z = a
e.p = a
e.y = k
l.o = b
l.u = c
assert b.o.o.u.v.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

b.o = l
b.u = c
c.v = a
k.q = a
k.w = a
k.x = g
a.v = g
a.z = c
a.y = k
g.u = a
g.z = a
g.p = a
g.y = k
h.v = a
e.u = a
e.z = a
e.p = a
e.y = k
l.o = b
l.u = c
assert b.o.o.u.v.y.w.txt == "a"