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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: F = None
        self.z: D = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: F = None
        self.o: G = None
        self.w: G = None
        self.r: G = None
        self.s: A = None
        self.p: F = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: F = None
        self.z: D = None
        self.s: F = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: F = None
        self.o: G = None
        self.w: G = None
        self.r: G = None
        self.s: A = None
        self.p: F = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.txt = txt

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

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