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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.z: B = None
        self.s: B = None
        self.q: F = None
        self.u: G = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.x: C = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.z: B = None
        self.s: B = None
        self.q: F = None
        self.u: G = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: H = None
        self.x: C = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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