class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.s: D = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: D = None
        self.r: D = None
        self.y: C = None
        self.w: B = None
        self.s: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.s: D = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: D = None
        self.r: D = None
        self.y: C = None
        self.w: B = None
        self.s: B = None
        self.o: C = None
        self.txt = txt

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

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

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