class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: A = None
        self.o: G = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.p: H = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.w: G = None
        self.z: D = None
        self.s: A = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.u: H = None
        self.x: D = None
        self.t: F = None
        self.o: D = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

m = A("m")
n = B("n")
f = C("f")
b = D("b")
j = E("j")
g = F("g")
c = G("c")
d = H("d")
k = A("k")

m.u = d
m.z = k
m.o = c
m.w = j
n.q = g
n.x = d
f.s = n
f.v = n
f.q = n
f.t = b
f.p = b
f.u = k
f.x = c
f.r = m
b.r = f
b.t = g
j.r = k
j.o = m
j.p = d
j.s = g
g.u = f
g.t = j
g.w = c
g.x = c
g.z = b
g.s = m
g.o = d
c.q = b
c.x = b
c.o = b
c.s = d
c.u = d
c.t = g
c.v = j
c.z = f
d.q = f
k.u = d
k.z = m
k.o = c
k.w = j
assert n.q.o.q.s.x.q.x.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: A = None
        self.o: G = None
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: A = None
        self.p: H = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.w: G = None
        self.z: D = None
        self.s: A = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.u: H = None
        self.x: D = None
        self.t: F = None
        self.o: D = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

m = A("m")
n = B("n")
f = C("f")
b = D("b")
j = E("j")
g = F("g")
c = G("c")
d = H("d")
k = A("k")

m.u = d
m.z = k
m.o = c
m.w = j
n.q = g
n.x = d
f.s = n
f.v = n
f.q = n
f.t = b
f.p = b
f.u = k
f.x = c
f.r = m
b.r = f
b.t = g
j.r = k
j.o = m
j.p = d
j.s = g
g.u = f
g.t = j
g.w = c
g.x = c
g.z = b
g.s = m
g.o = d
c.q = b
c.x = b
c.o = b
c.s = d
c.u = d
c.t = g
c.v = j
c.z = f
d.q = f
k.u = d
k.z = m
k.o = c
k.w = j
assert n.q.o.q.s.x.q.x.s.q.txt == "f"