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

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

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

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

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

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

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

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

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

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

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

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

i.s = g
i.r = g
i.y = l
i.o = l
i.w = l
g.v = b
g.o = e
g.x = e
g.y = l
b.s = m
b.r = m
l.q = m
l.v = e
n.s = l
n.z = i
n.y = m
j.s = l
j.z = i
j.y = m
m.s = b
m.r = b
e.v = b
e.o = g
e.x = g
e.y = l
h.s = l
h.z = i
h.y = b
f.s = l
f.z = i
f.y = b
assert i.y.q.r.s.s.r.r.s.s.r.txt == "m"