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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.v: G = None
        self.z: B = None
        self.q: C = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.v: G = None
        self.z: B = None
        self.q: C = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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