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

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

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

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

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

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

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

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

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

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

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

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

j.s = e
j.t = m
j.y = g
j.u = b
f.s = b
b.q = l
b.s = l
b.y = l
b.r = g
b.o = m
g.r = d
g.o = m
g.p = m
l.u = f
n.s = b
e.s = j
e.t = g
e.y = m
e.u = b
d.s = b
m.r = n
m.o = g
m.p = g
c.s = b
assert c.s.r.r.s.o.r.s.r.txt == "g"