class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.q: C = None
        self.w: D = None
        self.v: B = None
        self.o: C = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.q: C = None
        self.w: D = None
        self.v: B = None
        self.o: C = None
        self.r: G = None
        self.txt = txt

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

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