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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: B = None
        self.t: B = None
        self.s: I = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: H = None
        self.x: E = None
        self.z: C = None
        self.v: H = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: B = None
        self.t: B = None
        self.s: I = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: H = None
        self.x: E = None
        self.z: C = None
        self.v: H = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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