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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: D = None
        self.x: I = None
        self.z: D = None
        self.u: F = None
        self.w: C = None
        self.v: D = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.z: C = None
        self.r: G = None
        self.u: B = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: D = None
        self.x: I = None
        self.z: D = None
        self.u: F = None
        self.w: C = None
        self.v: D = None
        self.t: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.z: C = None
        self.r: G = None
        self.u: B = None
        self.w: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

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

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