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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: A = None
        self.x: A = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: G = None
        self.x: I = None
        self.q: H = None
        self.r: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: I = None
        self.p: D = None
        self.x: F = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: C = None
        self.s: C = None
        self.z: H = None
        self.w: E = None
        self.t: B = None
        self.p: F = None
        self.q: E = None
        self.r: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: A = None
        self.x: A = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: G = None
        self.x: I = None
        self.q: H = None
        self.r: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: I = None
        self.p: D = None
        self.x: F = None
        self.v: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: C = None
        self.s: C = None
        self.z: H = None
        self.w: E = None
        self.t: B = None
        self.p: F = None
        self.q: E = None
        self.r: H = None
        self.txt = txt

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

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