class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: D = None
        self.o: F = None
        self.t: B = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.z: G = None
        self.q: C = None
        self.x: G = None
        self.r: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.r: C = None
        self.z: G = None
        self.p: A = None
        self.w: C = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.z: G = None
        self.q: C = None
        self.x: G = None
        self.r: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.r: C = None
        self.z: G = None
        self.p: A = None
        self.w: C = None
        self.u: A = None
        self.txt = txt

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

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