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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: D = None
        self.y: G = None
        self.r: G = None
        self.p: E = None
        self.o: D = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.w: G = None
        self.o: D = None
        self.s: D = None
        self.u: D = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.o: A = None
        self.s: D = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.y: H = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

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

g = A("g")
l = B("l")
a = C("a")
k = D("k")
e = E("e")
h = F("h")
f = G("f")
d = H("d")
i = F("i")

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: D = None
        self.y: G = None
        self.r: G = None
        self.p: E = None
        self.o: D = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.w: G = None
        self.o: D = None
        self.s: D = None
        self.u: D = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.o: A = None
        self.s: D = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.y: H = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

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

g = A("g")
l = B("l")
a = C("a")
k = D("k")
e = E("e")
h = F("h")
f = G("f")
d = H("d")
i = F("i")

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