class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: I = None
        self.q: I = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.t: D = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.u: I = None
        self.x: B = None
        self.y: I = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.q: H = None
        self.t: B = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: I = None
        self.q: I = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.t: D = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: A = None
        self.u: I = None
        self.x: B = None
        self.y: I = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.q: H = None
        self.t: B = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

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

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