class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.o: B = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

i = A("i")
a = B("a")
n = C("n")
g = D("g")
j = E("j")
l = F("l")
e = B("e")
m = C("m")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

i = A("i")
a = B("a")
n = C("n")
g = D("g")
j = E("j")
l = F("l")
e = B("e")
m = C("m")

i.z = l
i.v = l
i.q = g
i.o = e
i.r = e
a.t = j
a.s = j
a.x = l
a.q = l
a.w = i
a.p = e
n.w = g
g.v = l
g.s = l
g.z = l
g.r = a
g.x = j
j.t = g
j.y = m
l.x = j
e.t = j
e.s = j
e.x = l
e.q = l
e.w = i
e.p = a
m.w = g
assert m.w.x.y.w.v.x.y.w.txt == "g"