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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: G = None
        self.o: C = None
        self.z: G = None
        self.s: H = None
        self.q: H = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.q: H = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: F = None
        self.q: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: G = None
        self.o: C = None
        self.z: G = None
        self.s: H = None
        self.q: H = None
        self.p: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.q: H = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: F = None
        self.q: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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