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

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

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

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

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

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

h = A("h")
c = B("c")
g = C("g")
d = D("d")
m = E("m")
j = F("j")
a = B("a")
n = B("n")
b = C("b")
i = E("i")

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

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

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

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

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

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

h = A("h")
c = B("c")
g = C("g")
d = D("d")
m = E("m")
j = F("j")
a = B("a")
n = B("n")
b = C("b")
i = E("i")

h.q = n
h.y = d
h.w = d
h.v = d
c.y = h
c.q = h
c.w = h
c.r = j
g.t = j
g.p = m
g.s = b
g.r = c
g.q = d
d.y = h
d.z = i
d.x = m
d.w = m
m.u = i
m.p = d
m.v = n
m.s = n
m.w = j
j.t = i
j.x = m
j.v = h
a.y = h
a.q = h
a.w = h
a.r = j
n.y = h
n.q = h
n.w = h
n.r = j
b.t = j
b.p = i
b.s = g
b.r = c
b.q = d
i.u = m
i.p = d
i.v = c
i.s = n
i.w = j
assert n.w.w.y.q.r.t.s.w.q.r.txt == "j"