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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

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