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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: D = None
        self.t: F = None
        self.o: E = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: D = None
        self.t: F = None
        self.o: E = None
        self.y: I = None
        self.txt = txt

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

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

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