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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.o: A = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: I = None
        self.y: I = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: D = None
        self.x: I = None
        self.t: D = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.z: G = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.o: A = None
        self.t: A = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: I = None
        self.y: I = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: D = None
        self.x: I = None
        self.t: D = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: D = None
        self.z: G = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

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

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