class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: B = None
        self.r: H = None
        self.u: E = None
        self.p: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: B = None
        self.s: G = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: B = None
        self.s: G = None
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.txt = txt

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

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

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