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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: A = None
        self.r: C = None
        self.v: F = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: A = None
        self.r: C = None
        self.v: F = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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