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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.t: I = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: C = None
        self.p: G = None
        self.t: B = None
        self.y: I = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.w: E = None
        self.r: B = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: B = None
        self.s: G = None
        self.r: F = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.t: I = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: C = None
        self.p: G = None
        self.t: B = None
        self.y: I = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.w: E = None
        self.r: B = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: B = None
        self.s: G = None
        self.r: F = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

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

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