class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

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

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

a.r = l
k.s = d
k.w = a
g.q = j
g.p = k
g.v = l
g.w = l
g.u = b
l.y = j
l.x = d
l.v = g
l.o = b
l.p = k
j.p = l
j.u = l
j.s = a
j.z = g
b.s = a
b.w = a
d.r = l
i.s = a
i.w = a
assert b.w.r.x.r.o.w.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

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

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

a.r = l
k.s = d
k.w = a
g.q = j
g.p = k
g.v = l
g.w = l
g.u = b
l.y = j
l.x = d
l.v = g
l.o = b
l.p = k
j.p = l
j.u = l
j.s = a
j.z = g
b.s = a
b.w = a
d.r = l
i.s = a
i.w = a
assert b.w.r.x.r.o.w.r.p.txt == "k"