class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: I = None
        self.w: G = None
        self.v: C = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: I = None
        self.s: I = None
        self.w: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: I = None
        self.z: F = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: H = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: I = None
        self.s: I = None
        self.w: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: I = None
        self.z: F = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: H = None
        self.t: C = None
        self.txt = txt

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

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