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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: H = None
        self.w: B = None
        self.y: F = None
        self.s: I = None
        self.o: D = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: H = None
        self.w: B = None
        self.y: F = None
        self.s: I = None
        self.o: D = None
        self.u: D = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: G = None
        self.txt = txt

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

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