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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.w: G = None
        self.r: E = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

k.z = n
k.w = n
k.t = h
k.r = b
h.q = k
h.z = m
f.q = j
f.z = j
f.w = c
f.r = m
f.v = m
j.s = h
j.u = h
j.x = b
j.v = a
m.o = a
n.y = a
c.s = n
a.s = h
a.u = h
a.x = c
a.v = j
b.s = n
g.q = a
g.z = a
g.w = c
g.r = m
g.v = m
assert h.z.o.x.s.y.v.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: D = None
        self.w: G = None
        self.r: E = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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