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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.p: E = None
        self.z: D = None
        self.y: F = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.r: A = None
        self.w: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.p: E = None
        self.z: D = None
        self.y: F = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.r: A = None
        self.w: A = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

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

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