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

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

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

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

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

b = A("b")
g = B("g")
m = C("m")
e = D("e")
k = E("k")
f = B("f")
n = D("n")
c = E("c")
i = C("i")

b.s = k
b.w = c
b.o = i
g.y = b
g.u = f
g.x = e
g.p = c
m.q = b
m.r = c
m.s = e
e.w = c
e.p = g
e.y = m
e.s = f
e.r = f
k.q = e
k.t = e
k.v = n
f.y = b
f.u = g
f.x = n
f.p = k
n.w = c
n.p = f
n.s = f
n.r = f
n.y = i
c.q = e
c.v = e
c.t = n
i.q = b
i.r = c
i.s = e
assert m.r.q.y.q.w.q.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

b = A("b")
g = B("g")
m = C("m")
e = D("e")
k = E("k")
f = B("f")
n = D("n")
c = E("c")
i = C("i")

b.s = k
b.w = c
b.o = i
g.y = b
g.u = f
g.x = e
g.p = c
m.q = b
m.r = c
m.s = e
e.w = c
e.p = g
e.y = m
e.s = f
e.r = f
k.q = e
k.t = e
k.v = n
f.y = b
f.u = g
f.x = n
f.p = k
n.w = c
n.p = f
n.s = f
n.r = f
n.y = i
c.q = e
c.v = e
c.t = n
i.q = b
i.r = c
i.s = e
assert m.r.q.y.q.w.q.y.r.txt == "c"