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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.o: C = None
        self.y: B = None
        self.t: C = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: I = None
        self.r: F = None
        self.y: F = None
        self.x: F = None
        self.o: G = None
        self.u: I = None
        self.z: G = None
        self.p: F = None
        self.txt = txt

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

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

b.x = k
b.q = l
e.u = b
l.u = b
l.s = k
l.x = k
l.v = i
l.q = j
l.z = e
c.p = i
j.o = b
j.s = l
k.y = e
k.t = e
k.v = h
k.s = i
f.u = e
f.y = e
f.s = l
f.o = l
f.t = l
f.r = b
i.w = k
i.r = k
i.y = k
i.x = k
i.p = k
i.s = h
i.u = h
i.o = f
i.z = f
h.t = c
h.y = c
h.s = e
h.o = e
h.x = b
h.w = l
h.u = f
h.v = j
assert k.s.o.t.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.o: C = None
        self.y: B = None
        self.t: C = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: I = None
        self.r: F = None
        self.y: F = None
        self.x: F = None
        self.o: G = None
        self.u: I = None
        self.z: G = None
        self.p: F = None
        self.txt = txt

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

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

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