class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: I = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: E = None
        self.s: F = None
        self.z: H = None
        self.q: I = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.w: C = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: E = None
        self.s: F = None
        self.z: H = None
        self.q: I = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.w: C = None
        self.z: F = None
        self.txt = txt

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

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