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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.x: C = None
        self.s: F = None
        self.q: H = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: A = None
        self.u: B = None
        self.y: H = None
        self.x: H = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.x: C = None
        self.s: F = None
        self.q: H = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: A = None
        self.u: B = None
        self.y: H = None
        self.x: H = None
        self.o: D = None
        self.txt = txt

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

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

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