class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.p: A = None
        self.r: D = None
        self.x: A = None
        self.t: G = None
        self.z: H = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: B = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.t: I = None
        self.p: A = None
        self.s: H = None
        self.x: E = None
        self.y: B = None
        self.o: G = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: I = None
        self.y: C = None
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.p: A = None
        self.r: D = None
        self.x: A = None
        self.t: G = None
        self.z: H = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: B = None
        self.u: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.t: I = None
        self.p: A = None
        self.s: H = None
        self.x: E = None
        self.y: B = None
        self.o: G = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: I = None
        self.y: C = None
        self.p: A = None
        self.v: E = None
        self.txt = txt

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

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

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