class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: F = None
        self.y: H = None
        self.s: B = None
        self.p: B = None
        self.q: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: I = None
        self.s: B = None
        self.p: I = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.z: H = None
        self.r: E = None
        self.y: A = None
        self.t: E = None
        self.x: I = None
        self.s: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: B = None
        self.p: I = None
        self.z: B = None
        self.t: I = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: I = None
        self.s: B = None
        self.p: I = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.z: H = None
        self.r: E = None
        self.y: A = None
        self.t: E = None
        self.x: I = None
        self.s: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: B = None
        self.p: I = None
        self.z: B = None
        self.t: I = None
        self.r: A = None
        self.txt = txt

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

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

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