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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: F = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: H = None
        self.r: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

i = A("i")
l = B("l")
m = C("m")
b = D("b")
f = E("f")
c = F("c")
a = G("a")
h = H("h")

i.x = m
l.z = m
l.p = h
l.w = f
l.t = a
m.p = h
m.x = c
m.z = c
b.o = h
b.z = a
f.s = h
f.o = h
f.r = i
c.o = m
c.s = m
c.w = h
c.y = l
c.x = a
a.p = f
a.r = i
a.u = l
a.t = b
h.o = a
h.y = a
h.x = m
h.u = i
assert b.z.r.x.p.x.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: F = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: H = None
        self.r: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.u: A = None
        self.y: G = None
        self.txt = txt

i = A("i")
l = B("l")
m = C("m")
b = D("b")
f = E("f")
c = F("c")
a = G("a")
h = H("h")

i.x = m
l.z = m
l.p = h
l.w = f
l.t = a
m.p = h
m.x = c
m.z = c
b.o = h
b.z = a
f.s = h
f.o = h
f.r = i
c.o = m
c.s = m
c.w = h
c.y = l
c.x = a
a.p = f
a.r = i
a.u = l
a.t = b
h.o = a
h.y = a
h.x = m
h.u = i
assert b.z.r.x.p.x.p.y.txt == "a"