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

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

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

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

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

l = A("l")
j = B("j")
k = C("k")
b = D("b")
c = E("c")
h = D("h")
i = E("i")
g = B("g")
f = C("f")

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

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

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

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

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

l = A("l")
j = B("j")
k = C("k")
b = D("b")
c = E("c")
h = D("h")
i = E("i")
g = B("g")
f = C("f")

l.u = i
l.r = b
l.s = b
l.x = c
j.q = k
j.w = k
k.p = l
k.r = h
k.y = f
k.q = j
b.p = j
b.r = g
b.v = g
b.s = l
b.y = k
c.x = k
c.y = j
c.u = j
c.w = g
c.q = g
h.p = j
h.r = g
h.v = g
h.s = l
h.y = f
i.x = f
i.y = j
i.w = j
i.u = j
i.q = g
g.q = f
g.w = k
f.p = l
f.r = b
f.y = k
f.q = j
assert b.r.q.p.u.w.q.txt == "k"