class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: C = None
        self.v: I = None
        self.r: H = None
        self.x: G = None
        self.y: G = None
        self.s: E = None
        self.w: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: A = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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