class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: B = None
        self.u: D = None
        self.w: H = None
        self.z: B = None
        self.s: F = None
        self.x: I = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: A = None
        self.r: F = None
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: A = None
        self.r: F = None
        self.q: A = None
        self.u: E = None
        self.txt = txt

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

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

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