class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: B = None
        self.r: H = None
        self.y: E = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.x: B = None
        self.o: F = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.x: B = None
        self.o: F = None
        self.q: E = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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