class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: G = None
        self.x: C = None
        self.p: F = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: I = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: I = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

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