class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.z: F = None
        self.y: F = None
        self.o: D = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: G = None
        self.s: A = None
        self.p: A = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.o: E = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: C = None
        self.r: C = None
        self.v: C = None
        self.w: C = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.z: F = None
        self.y: F = None
        self.o: D = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: G = None
        self.s: A = None
        self.p: A = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.o: E = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: C = None
        self.r: C = None
        self.v: C = None
        self.w: C = None
        self.o: B = None
        self.x: G = None
        self.txt = txt

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

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