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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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