class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: G = None
        self.x: F = None
        self.y: A = None
        self.t: C = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: H = None
        self.z: G = None
        self.p: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.u: H = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: G = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.txt = txt

j = A("j")
n = B("n")
l = C("l")
g = D("g")
a = E("a")
b = F("b")
h = G("h")
i = H("i")
d = G("d")

j.s = b
n.s = j
n.y = j
n.p = d
n.x = b
n.t = l
n.z = i
l.o = n
g.y = b
g.t = a
g.s = h
g.w = l
g.p = d
a.u = j
a.x = i
a.z = h
a.p = b
a.w = l
b.y = n
b.v = h
b.u = i
b.o = j
b.p = a
h.r = j
h.v = d
h.w = a
i.p = g
i.u = a
d.r = j
d.v = h
d.w = a
assert h.r.s.p.p.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: G = None
        self.x: F = None
        self.y: A = None
        self.t: C = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: H = None
        self.z: G = None
        self.p: F = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.u: H = None
        self.o: A = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: G = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.txt = txt

j = A("j")
n = B("n")
l = C("l")
g = D("g")
a = E("a")
b = F("b")
h = G("h")
i = H("i")
d = G("d")

j.s = b
n.s = j
n.y = j
n.p = d
n.x = b
n.t = l
n.z = i
l.o = n
g.y = b
g.t = a
g.s = h
g.w = l
g.p = d
a.u = j
a.x = i
a.z = h
a.p = b
a.w = l
b.y = n
b.v = h
b.u = i
b.o = j
b.p = a
h.r = j
h.v = d
h.w = a
i.p = g
i.u = a
d.r = j
d.v = h
d.w = a
assert h.r.s.p.p.o.s.txt == "b"