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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.y: E = None
        self.x: D = None
        self.u: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: E = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: B = None
        self.y: F = None
        self.w: I = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: A = None
        self.x: G = None
        self.q: G = None
        self.t: E = None
        self.w: D = None
        self.v: C = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

g = A("g")
e = B("e")
c = C("c")
l = D("l")
i = E("i")
m = F("m")
k = G("k")
h = H("h")
b = I("b")
a = C("a")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.y: E = None
        self.x: D = None
        self.u: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: E = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.o: B = None
        self.y: F = None
        self.w: I = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: A = None
        self.x: G = None
        self.q: G = None
        self.t: E = None
        self.w: D = None
        self.v: C = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

g = A("g")
e = B("e")
c = C("c")
l = D("l")
i = E("i")
m = F("m")
k = G("k")
h = H("h")
b = I("b")
a = C("a")

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