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

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

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

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

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

i = A("i")
j = B("j")
b = C("b")
l = D("l")
c = E("c")
n = C("n")
m = A("m")
g = A("g")
d = D("d")
f = B("f")

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

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

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

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

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

i = A("i")
j = B("j")
b = C("b")
l = D("l")
c = E("c")
n = C("n")
m = A("m")
g = A("g")
d = D("d")
f = B("f")

i.w = m
i.u = m
i.r = d
j.s = c
j.r = f
b.v = n
b.s = n
b.y = m
b.q = d
b.u = d
l.r = d
l.q = d
l.w = m
c.q = i
c.y = d
c.v = g
c.z = l
n.v = b
n.s = b
n.y = m
n.q = l
n.u = d
m.w = g
m.r = l
m.u = i
g.w = i
g.u = i
g.r = l
d.r = l
d.q = l
d.w = g
f.s = c
f.r = j
assert n.u.q.q.w.r.r.w.u.r.r.txt == "l"