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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.o: G = None
        self.q: C = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.u: E = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: G = None
        self.p: E = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

h = A("h")
e = B("e")
n = C("n")
f = D("f")
i = E("i")
g = F("g")
m = G("m")
l = G("l")

h.s = g
h.y = f
h.p = i
e.y = g
e.x = n
e.q = n
e.o = m
e.z = h
n.o = e
n.v = e
n.u = i
n.t = l
n.w = f
f.y = l
f.v = l
f.r = m
f.p = m
f.u = h
f.z = e
i.p = h
i.t = f
i.v = g
g.y = l
g.r = m
g.p = i
g.z = f
g.o = n
m.v = h
l.v = h
assert f.z.o.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.o: G = None
        self.q: C = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.u: E = None
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: G = None
        self.p: E = None
        self.z: D = None
        self.o: C = None
        self.txt = txt

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

h = A("h")
e = B("e")
n = C("n")
f = D("f")
i = E("i")
g = F("g")
m = G("m")
l = G("l")

h.s = g
h.y = f
h.p = i
e.y = g
e.x = n
e.q = n
e.o = m
e.z = h
n.o = e
n.v = e
n.u = i
n.t = l
n.w = f
f.y = l
f.v = l
f.r = m
f.p = m
f.u = h
f.z = e
i.p = h
i.t = f
i.v = g
g.y = l
g.r = m
g.p = i
g.z = f
g.o = n
m.v = h
l.v = h
assert f.z.o.v.p.txt == "i"