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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: H = None
        self.x: F = None
        self.t: F = None
        self.q: G = None
        self.v: G = None
        self.o: E = None
        self.u: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: A = None
        self.v: D = None
        self.x: I = None
        self.y: I = None
        self.q: G = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: H = None
        self.x: F = None
        self.t: F = None
        self.q: G = None
        self.v: G = None
        self.o: E = None
        self.u: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: A = None
        self.v: D = None
        self.x: I = None
        self.y: I = None
        self.q: G = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: C = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

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

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