class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: F = None
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.x: G = None
        self.v: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

a = A("a")
n = B("n")
l = C("l")
c = D("c")
d = E("d")
e = F("e")
m = G("m")
h = E("h")
f = D("f")
i = D("i")

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.x: G = None
        self.v: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

a = A("a")
n = B("n")
l = C("l")
c = D("c")
d = E("d")
e = F("e")
m = G("m")
h = E("h")
f = D("f")
i = D("i")

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