class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: E = None
        self.s: F = None
        self.z: B = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.y: C = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.t: D = None
        self.s: E = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.y: C = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.t: D = None
        self.s: E = None
        self.w: F = None
        self.txt = txt

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

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