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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: H = None
        self.z: A = None
        self.s: G = None
        self.x: G = None
        self.o: H = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.p: B = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: C = None
        self.p: C = None
        self.z: A = None
        self.q: H = None
        self.t: H = None
        self.r: F = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.t: F = None
        self.z: B = None
        self.y: F = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: H = None
        self.z: A = None
        self.s: G = None
        self.x: G = None
        self.o: H = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.p: B = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: C = None
        self.p: C = None
        self.z: A = None
        self.q: H = None
        self.t: H = None
        self.r: F = None
        self.v: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: E = None
        self.t: F = None
        self.z: B = None
        self.y: F = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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