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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: F = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: E = None
        self.y: E = None
        self.o: H = None
        self.v: B = None
        self.r: B = None
        self.s: E = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: C = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: F = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: E = None
        self.y: E = None
        self.o: H = None
        self.v: B = None
        self.r: B = None
        self.s: E = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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