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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: A = None
        self.z: H = None
        self.q: I = None
        self.y: C = None
        self.v: C = None
        self.u: H = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: A = None
        self.z: H = None
        self.q: I = None
        self.y: C = None
        self.v: C = None
        self.u: H = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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