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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: D = None
        self.o: I = None
        self.t: H = None
        self.v: G = None
        self.y: D = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: I = None
        self.q: B = None
        self.u: G = None
        self.r: H = None
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.r: C = None
        self.v: B = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: D = None
        self.o: I = None
        self.t: H = None
        self.v: G = None
        self.y: D = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: I = None
        self.q: B = None
        self.u: G = None
        self.r: H = None
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.r: C = None
        self.v: B = None
        self.s: H = None
        self.txt = txt

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

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

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

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