class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: G = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.s: G = None
        self.r: G = None
        self.z: G = None
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.s: G = None
        self.r: G = None
        self.z: G = None
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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