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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.w: C = None
        self.u: C = None
        self.y: G = None
        self.v: F = None
        self.s: G = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.u: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: E = None
        self.p: F = None
        self.s: G = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.z: E = None
        self.w: A = None
        self.y: C = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: C = None
        self.r: I = None
        self.p: I = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.w: C = None
        self.u: C = None
        self.y: G = None
        self.v: F = None
        self.s: G = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.u: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: E = None
        self.p: F = None
        self.s: G = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.z: E = None
        self.w: A = None
        self.y: C = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: C = None
        self.r: I = None
        self.p: I = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.txt = txt

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

d.y = j
d.u = b
h.z = j
h.t = j
h.w = g
h.u = g
h.q = g
h.r = g
h.y = i
h.s = i
h.v = e
g.o = d
g.v = h
g.u = i
g.r = i
j.u = f
j.z = f
j.x = c
j.p = e
j.s = i
j.y = d
c.x = g
c.p = g
c.t = g
c.u = e
c.w = h
c.y = j
c.s = j
c.r = f
c.q = b
e.o = h
e.r = h
e.x = j
e.z = c
e.w = d
e.y = g
e.v = f
i.x = f
i.o = g
i.r = g
i.t = d
i.s = c
i.w = b
f.q = g
f.x = g
f.r = b
f.p = b
f.v = j
b.t = i
b.w = j
assert g.r.s.w.q.o.u.w.p.x.txt == "j"