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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: A = None
        self.v: C = None
        self.s: H = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.p: A = None
        self.s: G = None
        self.t: B = None
        self.x: H = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: G = None
        self.w: B = None
        self.q: G = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: A = None
        self.v: C = None
        self.s: H = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.p: A = None
        self.s: G = None
        self.t: B = None
        self.x: H = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: G = None
        self.w: B = None
        self.q: G = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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