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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: F = None
        self.u: F = None
        self.v: E = None
        self.q: H = None
        self.s: G = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: F = None
        self.u: F = None
        self.v: E = None
        self.q: H = None
        self.s: G = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: A = None
        self.u: B = None
        self.txt = txt

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

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

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