class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.q: C = None
        self.s: G = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.p: G = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: G = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: H = None
        self.q: C = None
        self.s: G = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.p: G = None
        self.y: B = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: G = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

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

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