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

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

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

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

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

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

f.s = d
f.u = m
f.o = l
f.t = a
f.y = j
g.p = j
g.w = c
g.s = c
g.o = a
a.w = d
a.r = m
a.x = m
m.o = b
j.y = a
i.o = b
b.y = d
l.s = d
l.t = d
l.u = m
l.o = f
l.y = j
d.w = a
d.r = m
d.x = i
c.p = j
c.w = g
c.s = g
c.o = d
assert f.s.w.w.x.o.y.w.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: D = None
        self.o: A = None
        self.t: C = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

f.s = d
f.u = m
f.o = l
f.t = a
f.y = j
g.p = j
g.w = c
g.s = c
g.o = a
a.w = d
a.r = m
a.x = m
m.o = b
j.y = a
i.o = b
b.y = d
l.s = d
l.t = d
l.u = m
l.o = f
l.y = j
d.w = a
d.r = m
d.x = i
c.p = j
c.w = g
c.s = g
c.o = d
assert f.s.w.w.x.o.y.w.x.o.txt == "b"