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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.x: H = None
        self.z: D = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.x: H = None
        self.z: D = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.r: C = None
        self.txt = txt

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

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

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

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