class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.r: E = None
        self.t: F = None
        self.x: F = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.q: G = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.u: G = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.txt = txt

i = A("i")
k = B("k")
l = C("l")
f = D("f")
e = E("e")
g = F("g")
m = G("m")
h = A("h")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.q: G = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.u: G = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.txt = txt

i = A("i")
k = B("k")
l = C("l")
f = D("f")
e = E("e")
g = F("g")
m = G("m")
h = A("h")

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