class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: E = None
        self.q: E = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

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