class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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