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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: A = None
        self.x: B = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: A = None
        self.x: B = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

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

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